#include <iostream>
#include <random>
#include <vector>

#include "Afterglow.cuh"

int main() {
  //    for (int i = 0; i < 10; ++i) {
  //        myPrint(i);
  //    }
  std::default_random_engine e(time(nullptr));
  std::uniform_real_distribution<> d(-120, 20);

  int w{4096}, h{1024};
  initialize(w,h);

  std::vector<float> ve{};
  ve.reserve(w * h);
  for (int i{0}; i < w * h; ++i) {
    ve.push_back(d(e));
  }
  std::cout << std::endl;
  std::vector<float> data(w * h);
  auto t0 = clock();
  for (int i{0}; i != 1000; ++i) {
    foo(ve.data(), w, h, 20, -140, data.data());
  }
  auto t1 = clock();
  std::cout << "used time:" << (t1 - t0) * 1.0 / 1000;

  myFree();
  // system("pause");
}